package com.xit.hitmouse.controller;

import com.xit.hitmouse.dao.DBHelper;
import com.xit.hitmouse.service.MusicService;
import com.xit.hitmouse.service.ScoreService;

import android.content.Context;

public class Controller {
	Context context;  
    MusicService musicService;
    ScoreService scoreService;
	public Controller(Context context) {
		this.context=context;
		musicService = new MusicService(context);
		scoreService = new ScoreService(context);
	}
	public Controller(Context context,int resId) {
		this.context=context;
		musicService = new MusicService(context,resId);
		scoreService = new ScoreService(context);
	}
	public void play() {
	        musicService.playBackground();  
	    }  
	   
	    public void stop() {  
	        musicService.stop();  
	    }  
	   
	    public void pauseMusic() {  
	        musicService.pause();  
	    }  
	    
	    public void continuePlay() {  
	        musicService.continuePlay();  
	    }  
	      
	    public void close() {  
	        musicService.close();  
	    }  
	   
	    public void playSound(int resId) {  
	        musicService.playSound(resId);  
	    }  
	    public boolean isPlay(){
	    	return musicService.isNowPlay();
	    }
	    
	   public void saveScore(String name,int score){
		   scoreService.saveScore(name, score);
	   }
	   public String[] searchScore(){
		  return scoreService.searchScore();
	   }
}
